home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / Shareware World / Info / For Developers / PlayerPRO 5.2 Dev.Kit Mac / MADH Library 5.2 / MADLibrary Source / RDriver.h < prev    next >
Encoding:
Text File  |  1999-06-22  |  21.1 KB  |  604 lines  |  [TEXT/CWIE]

  1. /********************                        ***********************/
  2. //
  3. //    Player PRO 5.0 - DRIVER SOURCE CODE -
  4. //
  5. //    Library Version 5.0
  6. //
  7. //    To use with MAD Library for Mac: Symantec, CodeWarrior and MPW
  8. //
  9. //    Antoine ROSSET
  10. //    16 Tranchees
  11. //    1206 GENEVA
  12. //    SWITZERLAND
  13. //
  14. //    COPYRIGHT ANTOINE ROSSET 1996, 1997, 1998
  15. //
  16. //    Thank you for your interest in PlayerPRO !
  17. //
  18. //    FAX:                (+41 22) 346 11 97
  19. //    PHONE:             (+41 79) 203 74 62
  20. //    Internet:     RossetAntoine@bluewin.ch
  21. //
  22. /********************                        ***********************/
  23.  
  24. #ifndef __RDRIVERH__
  25. #define __RDRIVERH__
  26.  
  27. #include "MAD.h"
  28.  
  29. ////////////////////////////////////////////////
  30.  
  31. #ifdef _MAC_H
  32. #ifndef __SOUND__
  33. #include <Sound.h>
  34. #endif
  35.  
  36. #ifndef __RETRACE__
  37. #include <Retrace.h>
  38. #endif
  39. #endif
  40.  
  41. ////////////////////////////////////////////////
  42.  
  43. #ifdef _INTEL_H
  44. #ifndef __DSOUND_INCLUDED__
  45. #include <mmreg.h>
  46. #include <DSound.h>
  47. #endif
  48. #endif
  49.  
  50. ////////////////////////////////////////////////
  51.  
  52. #if defined(powerc) || defined (__powerc)
  53. #pragma options align=mac68k
  54. #else
  55. #if !defined(THINK_C)
  56. #pragma options align=mac68k
  57. #endif
  58. #endif
  59.  
  60. ////////////////////////////////////////////////
  61.  
  62. /********************                        ***********************/
  63. /***                         Define List                            ***/
  64. /********************                        ***********************/
  65.  
  66. #define NUMBER_NOTES        96
  67. #define NOFINETUNE            8363
  68. #define MIN_VOLUME            0
  69. #define MAX_VOLUME            64
  70. #define MAX_CHANVOL            128
  71. #define MAX_PANNING            64
  72. //#define MAXTRACK            32
  73. //#define MAXINSTRU            64
  74. #define MAXSAMPLE            64L
  75. #define MAXPATTERN            200
  76. #define MAXPATTERNSIZE        900
  77. #define MAX_ARP             3
  78. #define MAXPLUG                40
  79. /********************                        ***********************/
  80. /***                         Error messages                         ***/
  81. /********************                        ***********************/
  82.  
  83. enum
  84. {
  85.     MADNeedMemory                     = -1,
  86.     MADReadingErr                    = -2,
  87.     MADIncompatibleFile                = -3,
  88.     MADLibraryNotInitialized        = -4,
  89.     MADParametersErr                = -5,
  90.     MADUnknowErr                    = -6,
  91.     MADSoundManagerErr                = -7,
  92.     MADOrderNotImplemented            = -8,
  93.     MADFileNotSupportedByThisPlug    = -9,
  94.     MADCannotFindPlug                = -10,
  95.     MADMusicHasNoDriver                = -11,
  96.     MADDriverHasNoMusic                = -12
  97. };
  98.  
  99. /********************                        ***********************/
  100. /***                Channel structure definition                    ***/
  101. /********************                        ***********************/
  102.  
  103. struct Channel
  104. {
  105.         long        ID;                    // Channel ID - 0 to MAXTRACK
  106.  
  107.         Ptr            begPtr;                // Sample Data Ptr - Beginning of data
  108.         Ptr            maxPtr;                // Sample Data Ptr - End of data
  109.         Ptr            curPtr;                // Sample Data Ptr - Current position
  110.         long        sizePtr;            // Sample Size in bytes
  111.         
  112.         long        amp;                // Sample amplitude: 8 or 16 bits
  113.         
  114.         long        loopBeg;            // Loop Beginning
  115.         long        loopSize;            // Loop Size
  116.         
  117.         long        ins;                // Current Instrument ID
  118.         long        insOld;                // Previous Instrument ID played on this channel
  119.         long        samp;                // Current Sample ID
  120.         
  121.         long        fineTune;            // Finetune
  122.         
  123.         long        note;                // Note
  124.         long        noteOld;            // Previous note played on this channel
  125.         
  126.         long         period;                // Current period
  127.         long        periodOld;            // Previous period played on this channel
  128.         
  129.         long        vol;                // Channel vol (0 to 64)
  130.         long        pann;                // Channel pan (0 to 64)
  131.         
  132.         long         cmd;                // Command
  133.         Byte        arg;                // Argument of command
  134.         Byte        volcmd;                // Volume Command
  135.         
  136.         long         arp[ MAX_ARP];        // Used for arpeggio command
  137.         long         arpindex;            // Used for arpeggio command
  138.         Boolean        arpUse;
  139.         
  140.         char        viboffset;            // Used for vibrato command
  141.         long         vibdepth;            // Used for vibrato command
  142.         long         vibrate;            // Used for vibrato command
  143.         long        vibtype;            // Used for vibrato command
  144.         
  145.         long         slide;                // Used for slideUp and slideDown command
  146.         
  147.         long         pitchgoal;            // Used for portamento command
  148.         long         pitchrate;            // Used for portamento command
  149.         
  150.         long         volumerate;            // Used for slideVolume command
  151.         
  152.         long        oldArg[ 16];
  153.         long        oldVibrate;
  154.         long        oldVibdepth;
  155.         
  156.         Ptr            samplePtr;            // Used internaly by MADPlaySoundData & MADPlaySndHandle
  157.         
  158.         /**/
  159.         
  160.         Boolean        KeyOn;
  161.         short        a;
  162.         short        b;
  163.         short        p;
  164.         long        volEnv;
  165.         long        volFade;
  166.         
  167.         short        aa;
  168.         short        bb;
  169.         short        pp;
  170.         long        pannEnv;
  171.         
  172.         long        lAC;
  173.         
  174.         Ptr            prevPtr;
  175.         long        lastWordL, curLastWordL;
  176.         long        lastWordR, curLastWordR;
  177.         long        curLevelL, curLevelR;
  178.         
  179.         Boolean        LevelDirectionL, LevelDirectionR, RemoverWorking;
  180.         
  181.         long        prevVol0;
  182.         long        prevVol1;
  183.         
  184.         /**/
  185.         
  186.         Boolean        GEffect;
  187.         short        GPat, GReader;
  188.         
  189.         /**/
  190.         
  191.         Boolean        stereo;
  192.         
  193.         Byte        loopType;
  194.         Boolean        pingpong;
  195.         
  196.         long        preOff;
  197.         char        preVal, preVal2;
  198.         char        preValR, preVal2R;
  199.         
  200.         short        spreVal, spreVal2;
  201.         short        spreValR, spreVal2R;
  202.         long        TICKREMOVESIZE;
  203.         
  204.         
  205.         Boolean        PanningE8;
  206.         short        trig;
  207.         short        PatternLoopE6, PatternLoopE6Count, PatternLoopE6ID;
  208. };
  209. typedef        struct Channel    Channel;
  210.  
  211. /********************                        ***********************/
  212. /***         Music description - used in Import/Export filter    ***/
  213. /********************                        ***********************/
  214.  
  215. struct    MADMusic
  216. {
  217.     MADSpec                    *header;                                // Music Header - See 'MAD.h'
  218.     PatData                    *partition[ MAXPATTERN];                // Patterns
  219.     InstrData                *fid;                                    // Instruments
  220.     sData                    **sample;                                // Samples
  221.     Boolean                    musicUnderModification;                    // Tell the driver to NOT access music data
  222.     
  223. };
  224. typedef        struct MADMusic    MADMusic;
  225.  
  226. /********************                        ***********************/
  227. /***                  Driver Settings definition                    ***/
  228. /********************                        ***********************/
  229.  
  230. enum
  231. {
  232.     oldASCSoundDriver = 1,            // MAC ONLY,    // NOT SUPPORTED anymore
  233.     oldAWACSoundDriver,                // MAC ONLY        // NOT SUPPORTED anymore
  234.     MIDISoundDriver,                // MAC ONLY
  235.     SoundManagerDriver,                // MAC ONLY You should use only SoundManagerDriver for full compatibility !
  236.     QK25SoundDriver,                // MAC ONLY
  237.     DigiDesignSoundDriver,            // MAC ONLY
  238.     BeOSSoundDriver,                // BE ONLY when using with BeOS compatible systems ! - NOT FOR MAC
  239.     DirectSound95NT,                // WINDOWS 95/NT ONLY when using with PC compatible systems ! - NOT FOR MAC
  240.     Wave95NT,                        // WINDOWS 95/NT ONLY when using with PC compatible systems ! - NOT FOR MAC
  241.     NoHardwareDriver                // NO HARDWARE CONNECTION, will not produce any sound
  242. };
  243.  
  244. enum
  245. {
  246.     oldMonoOutPut = 1,                // NOT SUPPORTED anymore
  247.     oldStereoOutPut,                // NOT SUPPORTED anymore
  248.     DeluxeStereoOutPut,                // USE THIS ONE ONLY !!!!!!!!!!!!!!
  249.     PolyPhonic                        // Do NOT use it ! Standard hardware doesn't support it !
  250. };
  251.  
  252. struct MADDriverSettings
  253. {
  254.     short                    numChn;                                // Active tracks from 2 to 32, automatically setup when a new music is loaded
  255.     short                    outPutBits;                            // 8 or 16 Bits
  256.     unsigned long            outPutRate;                            // Fixed number, by example : rate44khz, rate22050hz, rate22khz, rate11khz, rate11025hz
  257.     short                    outPutMode;                            // Now, only DeluxeStereoOutPut is available !
  258.     short                    driverMode;                            // MIDISoundDriver, SoundManagerDriver, BeOSSoundDriver, DirectSound95NT or Wave95NT
  259. //    Boolean                    antiAliasing;                        // NOT USED anymore
  260.     Boolean                    repeatMusic;                        // If music finished, repeat it or stop.
  261.     Boolean                    sysMemory;                            // Allocate memory in Application Heap (false) or in System Heap (true)
  262. //    Boolean                    Interpolation;                        // NOT USED anymore
  263. //    Boolean                    MicroDelay;                            // NOT USED anymore
  264.     long                    MicroDelaySize;                        // Micro delay duration (in ms, max 1 sec = 1000 ms, min = 0 ms)
  265.     Boolean                    surround;                            // Surround effect active? true/false
  266.     Boolean                    Reverb;                                // Reverb effect active? true/false
  267.     long                    ReverbSize;                            // Reverb delay duration (in ms, min = 25 ms, max 1 sec = 1000 ms)
  268.     long                    ReverbStrength;                        // Reverb strength in % (0 <-> 70)
  269.     Boolean                    TickRemover;                        // Remove volume/sample/loop ticks.
  270.     long                    oversampling;                        // OverSampling value, 1 = normal; works ONLY on 64bits processor (PowerPC)
  271. };
  272. typedef struct MADDriverSettings MADDriverSettings;
  273.  
  274. /******************************************************************/
  275. //******************* MUSICS IMPORT/EXPORT PLUGS  *****************/
  276. //
  277. //    Protocol Version 2.3
  278. //
  279. //    To use with PlayerPRO for CodeWarrior
  280. //
  281. //    Your main function have to be in this form:
  282. //    OSErr main(     OSType order,
  283. //                    Ptr AlienFileName,
  284. //                    MADMusic *MadFile,
  285. //                    PPInfoRec *info,
  286. //                    MADDriverSettings *DriverParam);
  287. //
  288. //    Actual plug have to support these orders:
  289. //
  290. //    order: 'TEST':    check the AlienFile to see if your Plug really supports it.
  291. //    order: 'IMPT':    convert the AlienFile into a MADMusic. You have to allocate MADMusic.
  292. //    order: 'INFO':    Fill PPInfoRec structure.
  293. //    order: 'EXPT':    Convert the MADMusic into AlienFile. You have to create the AlienFile.
  294. //                    Don't delete the MADMusic Structure after conversion !!
  295. //
  296. //    An IMPORT plug have to support these orders: 'TEST', 'IMPT', 'INFO'
  297. //    An EXPORT plug have to support these orders: 'EXPT'
  298. //     An IMPORT/EXPORT plug have to support these orders: 'TEST', 'IMPT', 'INFO', 'EXPT'
  299. //
  300. //    About Resources:
  301. //
  302. //    Your Plug should have: Creator: 'SNPL', Type: 'IMPL' - MAC ONLY
  303. //
  304. //    Your Plug have to have these resources - MAC ONLY:
  305. //
  306. //    - One segment CODE 1000 with 68k Code
  307. //    - One segment PPCC 1000 with PPC Code (OPTIONAL: if PlayerPRO in PPC cannot find it, it will use the CODE 1000 resource)
  308. //    - One STR# resource :
  309. //
  310. //        1 string: which kind of files your plug support (OSType value!!! 4 char) By example: 'STrk', '669 ', etc...
  311. //        2 string: what does your Plug: EXPL : only Export files, IMPL : only Import Files, EXIM : import AND export.
  312. //        3 string: string that will be used in Import and Export menu of PlayerPRO
  313. //        4 string: Copyright string of this plug.
  314. //
  315. /********************                        ***********************/
  316.  
  317. struct PPInfoRec
  318. {
  319.     char        internalFileName[ 60];
  320.     char        formatDescription[ 60];
  321.     
  322.     long        totalPatterns;
  323.     long        partitionLength;
  324.     
  325.     short        totalTracks;
  326.     short        totalInstruments;
  327.     
  328.     OSType        signature;
  329.     
  330.     long        fileSize;
  331.     
  332. };
  333. typedef struct PPInfoRec PPInfoRec;
  334.  
  335.  
  336. /********************                        ***********************/
  337. /***             Informations about Plugs: ThePlug[]                ***/
  338. /********************                        ***********************/
  339.  
  340. #ifdef _MAC_H
  341. struct PlugInfo
  342. {
  343.     Handle        IOPlug;                                            // Plug CODE
  344.     Str63        MenuName;                                        // Plug name
  345.     Str63        AuthorString;                                    // Plug author
  346.     FSSpec        file;                                            // Location of plug file
  347.     char        type[ 5];                                        // OSType of file support
  348.     OSType        mode;                                            // Mode support : Import +/ Export
  349.     Boolean        hasPPCCode;                                        // Is Plug FAT?
  350. };
  351. typedef struct PlugInfo PlugInfo;
  352. #endif
  353.  
  354. #ifdef _INTEL_H
  355. //#include "windows.h"
  356. typedef OSErr (*PLUGDLLFUNC) ( OSType , Ptr , MADMusic* , PPInfoRec *, MADDriverSettings *);
  357. struct PlugInfo
  358. {
  359.     HANDLE            hLibrary;
  360.     PLUGDLLFUNC        IOPlug;                                        // Plug CODE
  361.     char            MenuName[ 65];                                // Plug name
  362.     char            AuthorString[ 65];                            // Plug author
  363.     char            file[ 255];                                    // Location of plug file
  364.     char            type[ 5];                                    // OSType of file support
  365.     OSType            mode;                                        // Mode support : Import +/ Export
  366. };
  367. typedef struct PlugInfo PlugInfo;
  368. #endif
  369.  
  370. #ifdef _BE_H
  371.  
  372. typedef    OSErr (*MADPlug)( OSType order, Ptr AlienFileName, MADMusic *MadFile, PPInfoRec *info, MADDriverSettings *init);
  373.  
  374. struct PlugInfo
  375. {
  376.     image_id        hLibrary;
  377.     MADPlug            IOPlug;                                        // Plug CODE
  378.     char            MenuName[ 65];                                // Plug name
  379.     char            AuthorString[ 65];                            // Plug author
  380.     char            file[1024];                                    // Location of plug file
  381.     char            type[ 5];                                    // OSType of file support
  382.     OSType            mode;                                        // Mode support : Import +/ Export
  383. };
  384. typedef struct PlugInfo PlugInfo;
  385. #endif
  386. /********************                        ***********************/
  387. /***         Global structure : PlayerPRO variables                ***/
  388. /********************                        ***********************/
  389.  
  390. struct MADLibrary
  391. {
  392.     long                    IDType;                                // IDType = 'MADD' -- READ ONLY --
  393.     Boolean                    sysMemory;
  394.     long                    mytab[ 12];
  395.     
  396.     /** Plugs Import/Export variables **/
  397.     
  398.     PlugInfo                 *ThePlug;                            // Pointers on plugs code & infos
  399.     short                    TotalPlug;                            // no of Plugs in pointer ThePlug
  400.  
  401. };
  402. typedef struct MADLibrary MADLibrary;
  403.  
  404. struct MADDriverRec
  405. {
  406.     /**********************/
  407.     /** Public variables **/
  408.     /**********************/
  409.     
  410.     MADDriverSettings        DriverSettings;                                    // Driver SetUp -- READ ONLY --
  411.     
  412.     /**  Current music in memory, loaded with RLoadMusic() by example **/
  413.     
  414.     MADMusic                *curMusic;                                        // Current music played by this driver, it can be 0L !!!
  415.     MADLibrary                *lib;
  416.     
  417.     /**  Drivers variables **/
  418.     
  419.     Channel                    chan[ MAXTRACK];                                // Current driver channels -- READ ONLY --
  420.     Boolean                    musicEnd;                                        // Is music playing finished? -- READ ONLY --
  421.     short                    Tube[ MAXTRACK];                                // Used in 'Tracks View' Window - View menu 
  422.     short                    PartitionReader;                                // Current position in pattern (0...999)
  423.     short                    Pat;                                            // Current ID Pattern, see 'Patterns list'
  424.     short                    PL;                                                // Current position in partition, see 'Partition list'
  425.     long                    VolGlobal;                                        // Global SOFTWARE volume (This is NOT Mac hardware volume!) from 0 to 64
  426.     short                    speed;                                            // Current speed, see speed Effect
  427.     short                    finespeed;                                        // Current finespeed, see speed Effect
  428.     short                    InstruTube[ MAXINSTRU];                            // Used in 'Instrument View' Window - View menu
  429.     short                    VExt;                                            // External music speed, see 'Adaptators' window. 80 = normal
  430.     short                    FreqExt;                                        // External music pitch, see 'Adaptators' window. 80 = normal
  431.     Boolean                    Reading;                                        // Reading indicator
  432.     Boolean                    Active[ MAXTRACK];                                // Channel Active?
  433.     
  434.     #ifdef _MAC_H
  435.     SndChannelPtr             MusicChannelPP;                                    // The SndChannelPtr to apply SndDoCommand, etc.
  436.     #endif                                                                    // ONLY available if you are using MAC SoundManager driver
  437.     
  438.     #ifdef _INTEL_H
  439.     LPDIRECTSOUND            lpDirectSound;                                    // The LPDIRECTSOUND to apply & get informations, etc.
  440.     LPDIRECTSOUNDBUFFER        lpDirectSoundBuffer, lpSwSamp;                    // ONLY available if you are using Win95 DirectSound driver
  441.     #endif    
  442.     
  443.     Ptr                        OscilloWavePtr;                                    // Contains actual sound wave of music, in char (8 bits) or in short (16 bits)
  444.     long                    OscilloWaveSize;                                // Size of previous buffer
  445.     
  446.     /** Private variables - Not documented **/
  447.     /* DO NOT MODIFY OR USE these variables */
  448.     
  449.     long                    BytesToRemoveAtEnd, MIN_PITCH, MAX_PITCH, MOD_MIN_PITCH, MOD_MAX_PITCH, ASCBUFFERReal;
  450.     short                    smallcounter, trackDiv;
  451.     long                    FREQBASE;
  452.     short                    InstruActif[ MAXINSTRU];
  453.     Ptr                        SysHeapPtr, IntDataPtr;
  454.     Boolean                    XMLinear, MODMode, JumpToNextPattern, endPattern, MADPlay;
  455.     long                    ASCBUFFER;
  456.     long                    BufSize;
  457.     long                    VSYNC, BufCounter, BytesToGenerate;
  458.     short                    vibrato_table[ 64];
  459.     short                    SendMIDIClockData;    //gOutNodeRefNum, MIDIPortRefNum
  460.     short                    InstuNoOld[ MAXTRACK];
  461.     short                    NoteOld[ MAXTRACK];
  462.     short                    VelocityOld[ MAXTRACK];
  463.     Boolean                    TrackLineReading[ MAXTRACK], wasReading;
  464.     Ptr                        OverShoot;
  465.     long                    *DASCBuffer;
  466.     short                    *DASCBuffer8;
  467.     long                    MDelay;
  468.     long                    RDelay;
  469.     Ptr                        ReverbPtr;
  470.     short                    PatDelay;
  471.     
  472.     #ifdef _MAC_H
  473.     SndDoubleBufferHeader     TheHeader;
  474.     
  475.     #endif
  476. };
  477. typedef struct MADDriverRec MADDriverRec;
  478.  
  479. /********************                        ***********************/
  480. /***                        EFFECTS ID                            ***/
  481. /********************                        ***********************/
  482.  
  483. enum {
  484.         arpeggioE         = 0,    //    0x00
  485.         downslideE         = 1,    //    0x01
  486.         upslideE         = 2,    //    0x02
  487.         portamentoE     = 3,    //    0x03
  488.         vibratoE         = 4,    //    0x04
  489.         portaslideE     = 5,    //    0x05
  490.         vibratoslideE    = 6,    //    0x06
  491.         nothingE         = 7,    //    0x07
  492.         panningE        = 8,    //    0x08
  493.         offsetE         = 9,    //    0x09
  494.         slidevolE         = 10,    //    0x0A
  495.         fastskipE         = 11,    //    0x0B
  496.         volumeE         = 12,    //    0x0C
  497.         skipE             = 13,    //    0x0D
  498.         extendedE         = 14,    //    0x0E
  499.         speedE             = 15    //    0x0F
  500.     };
  501.  
  502. /********************                        ***********************/
  503. /***                        FUNCTIONS                            ***/
  504. /********************                        ***********************/
  505.  
  506.  
  507. #ifdef __cplusplus
  508. extern "C" {
  509. #endif
  510.  
  511. void MyDebugStr( short, char*, char*);                                // Internal Debugger function, NORMALLY it is never called, only when FATAL error
  512.                                                                     // You NEED to provide this function, see examples!
  513.  
  514. MADLibrary* MADGetMADLibraryPtr();                                    // Get MADDriver structure pointer.
  515.  
  516. OSErr    MADInitLibrary( char *PlugsFolderName, Boolean sysMemory, MADLibrary **MADLib);    // Library initialisation, you have to CALL this function if you want to use other functions & variables
  517. OSErr    MADDisposeLibrary( MADLibrary *MADLib);                        // Close Library, close music, close driver, free all memory
  518.  
  519. void    MADGetBestDriver( MADDriverSettings    *DriverInitParam);        // Found and identify the current Mac sound hardware and fill DriverInitParam
  520. OSErr    MADCreateDriver( MADDriverSettings    *DriverInitParam, MADLibrary *MADLib, MADDriverRec** returnDriver);        // Music Driver initialization and memory allocation
  521. OSErr    MADDisposeDriver( MADDriverRec *MDriver);                                            // Dispose the music driver, use it after RInitMusic()
  522.  
  523. OSErr    MADChangeDriverSettings( MADDriverSettings    *DriverInitParam, MADDriverRec** returnDriver);
  524.  
  525. OSErr    MADStartDriver( MADDriverRec *MDriver);                                        // NEW - Activate the sound generating procedure (interruption)
  526. OSErr    MADStopDriver( MADDriverRec *MDriver);                                        // NEW - DESActivate the sound generating procedure (interruption)
  527.  
  528. OSErr    MADPlayMusic( MADDriverRec *MDriver);                                        // NEW - Read and play current music in memory - Call MADStartInterruption BEFORE
  529. OSErr    MADStopMusic( MADDriverRec *MDriver);                                        // NEW - Stop reading current music in memory, Use MADCleanDriver to stop sounds
  530. void    MADCleanDriver( MADDriverRec *intDriver);                                    // Clean the driver : stop playing sounds
  531.  
  532. OSErr    MADReset( MADDriverRec *MDriver);                                            // Reset the current music at the start position
  533. OSErr    MADGetMusicStatus( MADDriverRec *MDriver, long *fullTime, long *curTime);            // Get informations about music position and duration, IN 1/60th SECS !! NOT IN SECS ANYMORE !!!!!!!
  534. OSErr    MADSetMusicStatus( MADDriverRec *MDriver, long minV, long maxV, long curV);            // Change position of current music, by example MADSetMusicStatus( 0, 100, 50) = go to the middle of the music
  535.  
  536. OSErr    MADSetHardwareVolume( long);                                // 0...64, Mac HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
  537. long    MADGetHardwareVolume( void);                                        // Return HARDWARE volume, see MADDriver->VolGlobal for SOFTWARE volume
  538.  
  539. OSErr    MADAttachDriverToMusic( MADDriverRec *driver, MADMusic *music);
  540.  
  541. OSErr    MADLoadMusicRsrc( MADMusic **music, OSType IDName, short IDNo);                // MAD ONLY - Load a MAD Rsrc into memory
  542. OSErr    MADLoadMusicPtr( MADMusic **music, Ptr myPtr);                                // MAD ONLY - Load a MAD Ptr into memory, you can DisposPtr your Ptr after this call
  543.  
  544. OSErr    MADLoadMusicFilePString( MADLibrary *, MADMusic **music, char *type, Str255 fName);            // Load a music file with plugs
  545. OSErr    MADLoadMusicFileCString( MADLibrary *, MADMusic **music, char *type, Ptr fName);            // Load a music file with plugs
  546. OSErr    MADLoadMusicFSpFile( MADLibrary *, MADMusic **music, char *type, FSSpec *theSpec);            // Load a music file with plugs
  547.  
  548. OSErr    MADMusicIdentifyPString( MADLibrary *, char *type, Str255 pName);            // Identify what kind of music format is pName file.
  549. OSErr    MADMusicIdentifyCString( MADLibrary *, char *type, Ptr cName);            // Identify what kind of music format is cName file.
  550. OSErr    MADMusicIdentifyFSp( MADLibrary *, char *type, FSSpec *theSpec);            // Identify what kind of music format is theSpec file.
  551.  
  552. Boolean    MADPlugAvailable( MADLibrary *, char *type);                                // Is plug 'type' available?
  553.  
  554. OSErr    MADDisposeMusic( MADMusic **, MADDriverRec *MDriver);                                // Dispose the current music, use it after RLoadMusic(), RLoadMusicRsrc(), RInstallMADF()
  555.  
  556. void    MADChangeTracks( MADDriverRec *MDriver, short);                // Change current tracks number of the music driver
  557. Cmd*    GetMADCommand(    short        position,                        // Extract a Command from a PatData structure
  558.                         short        channel,
  559.                         PatData*    aPatData);
  560.  
  561. OSErr    MADPlaySndHandle(     MADDriverRec *MDriver,
  562.                             Handle sound,                            // Handle to a 'snd ' handle, by ex: GetResource('snd ', 128);
  563.                             long chan,                                // channel ID on which to play sound
  564.                             long note);                                // note: 0 to NUMBER_NOTES or 0xFF: play sound at his normal sampleRate Khz
  565.  
  566. OSErr    MADPlaySoundData(    MADDriverRec *MDriver,
  567.                             Ptr                soundPtr,                // Sound Pointer to data
  568.                             long            size,                    // Sound size in bytes
  569.                             long            channel,                // channel ID on which to play sound
  570.                             long            note,                    // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
  571.                             long            amplitude,                // 8 or 16 bits
  572.                             long            loopBeg,                // loop beginning
  573.                             long            loopSize,                // loop size in bytes
  574.                             unsigned long    rate,                    // sample rate of the sound data, by ex: rate22khz
  575.                             Boolean            stereo);                // sample is in stereo or in mono?
  576.                             
  577. OSErr    MADPlaySoundDataSYNC(MADDriverRec *MDriver,
  578.                             Ptr                soundPtr,                // Sound Pointer to data
  579.                             long            size,                    // Sound size in bytes
  580.                             long            channel,                // channel ID on which to play sound
  581.                             long            note,                    // note: 0 to NUMBER_NOTES or 0xFF: play sound at 22 Khz
  582.                             long            amplitude,                // 8 or 16 bits
  583.                             long            loopBeg,                // loop beginning
  584.                             long            loopSize,                // loop size in bytes
  585.                             unsigned long    rate,                    // sample rate of the sound data, by ex: rate22khz
  586.                             Boolean            stereo);                // sample is in stereo or in mono?
  587.  
  588. Ptr MADNewPtr( long size, MADLibrary* init);
  589. Ptr MADNewPtrClear( long size, MADLibrary* init);
  590.  
  591. void MyDebugStr(short, Ptr, Ptr);                                    // Called when a fatal error occurs.... Normally, NEVER !
  592.  
  593. #ifdef __cplusplus
  594. }
  595. #endif
  596.  
  597. #if defined(powerc) || defined (__powerc)
  598. #pragma options align=reset
  599. #else
  600. #if !defined(THINK_C)
  601. #pragma options align=reset
  602. #endif
  603. #endif
  604. #endif